package com.husky.easyexcle.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.FillPatternType;

/**
 * @author huanfuan
 * @date 2023/5/27 10:24
 */


@ColumnWidth(25)  //列宽
@HeadRowHeight(-1) //标题行高
@HeadFontStyle(fontHeightInPoints = 12, color = 9) //
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 62)
@Data // lombok注解
@Slf4j
public class TaskDefinitionEntity {

    @ExcelProperty(value = {"作业流配置","需求编号","可输入字母、数字、下划线组合，仅字母开头。该字段来自需求中心。"}, index = 0)
    private String numberId;
    @ExcelProperty(value = {"作业流配置","项目code","填写项目编号，来自“项目管理”功能录入的项目数据"} ,index = 1)
    private String projectCode;
    @ExcelProperty(value = {"作业流配置","作业流名称","必填：作业流名称命名规范：JF_1000001（10代表1代ODS抽数作业流）\n" +
            "JF_1100001（11代表2代ODS抽数作业流）\n" +
            "JF_2100001（21代表缓冲层数据加载作业流）\n" +
            "JF_3100001（31代表贴源层数据加载作业流）\n" +
            "JF_4100001（41代表模型层数据加载作业流）\n" +
            "JF_5100001（51代表汇总层数据加载作业流）"}, index = 2)
    private String processName;
    @ExcelProperty(value = {"作业流配置","作业流中文名称","必填：方便后期运维人员查看。\n" +
            "输入当前作业流的中文名称"},index = 3)
    private String zhName;
    @ExcelProperty(value = {"作业流配置","作业流定时执行开关","必填：如果要开启定时执行作业流，填：是\n" +
            "如果不需要开启定时执行作业流，填：否"} ,index = 4)
    private String schedulerEnable;
    @ExcelProperty(value = {"作业流配置","作业流开始执行时间","作业流定时开关为：是，该项必填(例：2022-8-22 00:00:00）"} ,index = 5)
    private String schedulerStartTime;
    @ExcelProperty(value = {"作业流配置","作业流结束执行时间","作业流定时开关为：是，该项必填（例：2022-8-23 00:00:00）"} ,index = 6)
    private String schedulerEndTime;
    @ExcelProperty(value = {"作业流配置","定时配置","作业流定时开关为：是，该项必填\n" +
            "请输入Cron正则表达式，例如：\n" +
            "\"0 0 12 ? * WED\" 在每星期三下午12:00 执行"},index = 7)
    private String schedulerTime;

    @ExcelProperty(value = {"作业配置\n","作业名称","作业名称规范：\n" +
            "JOB_存储过程名（去掉前缀PR）eg.JOB_S_CBBS_FCRDB_CH_ACCT_MAST（缓冲层作业）JOB_O_CBBS_FCRDB_CH_ACCT_MAST（贴源层作业）\n" +
            "JOB_T01_PARTY_CBBS（模型层作业）\n" +
            "JOB_C01_CUST（汇总层作业）"},index = 8)
    private String name;
    @ExcelProperty(value = {"作业配置\n","作业类型","离线集成作业填：FlinkX\n" +
            "数据开发作业填写：Shell"},index = 9)
    private String taskType;
    @ExcelProperty(value = {"作业配置\n","作业执行脚本","数据开发：填写shell脚本\n" +
            "离线集成：需要把执行的json脚本填入"},index = 10)
    private String rawScript;
    @ExcelProperty(value = {"作业配置\n","资源","要引用的资源文件名称，资源文件通过文件上传模块上传至资源管理\n"},index = 11)
    private String resourceList;
    @ExcelProperty(value = {"作业配置\n","运行模式","组件类型为FLINKX时需填写运行模式，可填：Local,Standalone,Yarn"},index = 12)
    private String model;
    @ExcelProperty(value = {"作业配置\n","自定义参数","离线集成作业（flinkx）的自定义参数写JSON格式内容\n" +
            "数据开发作业填写数据开发参数内容"},index = 13)
    private String localParams;
    @ExcelProperty(value = {"作业配置\n","前置作业","作业执行顺序，仅填写该作业的前置作业，如有多个前置作业，使用英文逗号隔开，没有则不填"},index = 14)
    private String preTaskName;
    @ExcelProperty(value = {"作业配置\n","作业优先级","可填：HIGHEST,HIGH,MEDIUM,LOW,LOWEST"},index = 15)
    private String taskPriority;
    @ExcelProperty(value = {"作业配置\n","worker分组","按照系统中配置的Worker分组填写，可填default"},index = 16)
    private String workerGroupName;
    @ExcelProperty(value = {"作业配置\n","作业描述","作业的描述信息，可填任务的中文名称"},index = 17)
    private String description;
    @ExcelProperty(value = {"作业配置\n","作业组名称","在作业组管理模块配置的作业组名称"},index = 18)
    private String taskGroupName;
    @ExcelProperty(value = {"作业配置\n","组内优先级(整数)","在作业组内执行的优先级，可填：0,1,2,3,4,…"},index = 19)
    private String taskGroupPriority;
    @ExcelProperty(value = {"作业配置\n","失败重试次数(整数)","作业失败后的重试次数,可填：0,1,2,3,…"},index = 20)
    private String retryTimes;
    @ExcelProperty(value = {"作业配置\n","失败重试间隔(单位：分钟)","失败重试的间隔时间（单位：分钟），可填：0,1,2,3,..."},index = 21)
    private String retryInterval;
    @ExcelProperty(value = {"作业配置\n","延时执行时间(单位：分钟)","作业需要延时执行时间（单位：分钟），可填：0,1,2,3,..."},index = 22)
    private String delayTime;
    @ExcelProperty(value = {"作业配置\n","超时告警开关","超时告警开关，可填：是，否"},index = 23)
    private String timeoutAlarm;
    @ExcelProperty(value = {"作业配置\n","超时策略","超时告警开关为是，需填写超时策略，可填：超时告警，超时失败"},index = 24)
    private String timeoutStratege;
    @ExcelProperty(value = {"作业配置\n","超时时长","超时告警开关为是，需填写超时时长（单位：分钟），可填：0,1,2,3,..."},index = 25)
    private String timeout;
    @ExcelProperty(value = {"作业配置\n","离线集成任务ID","离线集成（flinkx）任务ID"},index = 26)
    private String taskId;
    @ExcelProperty(value = {"作业配置\n","离线任务类型","flinkx的任务运行类型，可填sync和sql两种"},index = 27)
    private String type;
    @ExcelProperty(value = {"作业配置\n","离线集成轮询标志","flinkx是否是轮询类型，可以选择：是或者否"},index = 28)
    private String cycle;
    @ExcelProperty(value = {"作业配置\n","离线集成轮询间隔时间","flinkx任务是轮询任务时,每次查询的间隔，单位为秒"},index = 29)
    private String cycleInterval;
    @ExcelProperty(value = {"作业配置\n","离线任务插件类型","离线集成作业必选：可填shellx或flinkx或sparkx"},index = 30)
    private String pluginType;
    @ExcelProperty(value = {"作业配置\n","数据源ID","系统管理，数据源管理模块创建的数据源ID，由离线开发模块导出时填入"},index = 31)
    private String sqlResourceId;
    @ExcelProperty(value = {"作业配置\n","前置SQL","前置SQL语句，非查询语句（存在多条换行且以分号结尾)"},index = 32)
    private String preStatementsSQl;
    @ExcelProperty(value = {"作业配置\n","后置SQL","后置SQL语句，非查询语句（存在多条换行且以分号结尾)"},index =33)
    private String postStatementsSql;
    @ExcelProperty(value = {"作业配置\n","查询结果显示行数","待定看需求，默认10条"},index = 34)
    private String result;

}
